<!DOCTYPE HTML>
<html>
<head>
    <meta charset="UTF-8">
    <title>VerticalList2</title>
    <script>
        var w = document.documentElement.clientWidth / 10;
        document.getElementsByTagName('html')[0].style['font-size'] = w + 'px';
    </script>
    <style>
        html, body {
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            overflow: hidden;
        }

        #main {
            position: absolute;
            left: 10%;
            top: 10%;
            width: 80%;
            height: 80%;
            overflow: hidden;
        }

        .scroll-item {
            display: inline-block;
            margin: 0.1rem;
            width: 1.6rem;
            height: 2rem;
            background: #4271ae;
            opacity: 0.5;
        }

        .scroll-item.fe-focus {
            animation: item-focused 500ms ease-in forwards;
        }

        @keyframes item-focused {
            from {
                opacity: 0.6
            }
            to {
                opacity: 1
            }
        }
    </style>
</head>
<body>
<div id="main" fe-role="Scroll">
    <div id="main-list" class="scroll-list">
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item" fe-cfg="default_focus:yes,scroll_to_start:yes,"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
        <div fe-role="Widget" class="scroll-item"></div>
    </div>
</div>
<script src="../FocusEngine.min.js"></script>
<script src="../TVUtil.js"></script>

<script>
    // var mainList = document.getElementById('main-list');
    // // 动态增加元素
    // var _html = "";
    // for(var i = 0; i < 100; i++) {
    //     _html += "<div fe-role=\"Widget\" class=\"scroll-item\"> </div>";
    // }
    // mainList.innerHTML += _html;

    var root = FocusEngine.render();

    var _focus = new TVUtil.Highlight({
        root: root,
        styles: {
            border: 'solid .05rem #ffffff'
        }
    });
</script>
</body>

</html>
